{layout name="layout" /}

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header layuiadmin-card-header-auto"></div>
        <div class="layui-card-body">
            <table id="zbc-wechat-reply" lay-filter="zbc-wechat-reply"></table>
        </div>
    </div>
</div>

<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-container">
        <button class="layui-btn layuiadmin-btn-useradmin" data-type="batchdel">删除</button>
        <button class="layui-btn layuiadmin-btn-useradmin" data-type="add">添加</button>
    </div>
</script>

<script type="text/html" id="table-content-operation">
    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
</script>

<script type="text/html" id="table-content-enabled">
    {{d.enabled=="1"?"开启":"关闭"}}
</script>

<script type="text/html" id="table-content-type">
    {{d.type=="text"?"文本消息":d.type=="image"?"图片消息":d.type=="news"?"图文消息":d.type=="music"?"声音消息":"未知类型"}}
</script>

<script>
 layui.config({
    base:'/static/layuiadmin/'
 }).extend({
    index: 'lib/index' //主入口模块
 })
 .use(["index","curdtable"],function(index,curdtable){
    curdtable.init({
        TABLEID:"zbc-wechat-reply",
        PAGEURL: '/admin/wechatkeyword/index',
        DELETEURL:'/admin/wechatkeyword/delete',
        EDITURL:'/admin/wechatkeyword/update',
        ADDURL: '/admin/wechatkeyword/create',
        EDITTITLE: '添加回复',
        ADDTITLE: '添加关键字',
        LAYERAREA: ['1024px', '600px'],
        FORMSUBMIT: "zbc-wechat-submit",
        cols:[
           [
            {type:"checkbox"},
            {type:"numbers",title:"序号"},
            {field:"id",title:"编号"},
            {field:"keyword",title:"关键字"},
            {field:"type",title:"回复类型",templet:"#table-content-type"},
            {field:"enabled",title:"状态",templet:"#table-content-enabled"},
            {
                title:"操作",
                toolbar:"#table-content-operation"
            }
           ]
        ]
    }).render();
 })

</script>